from lxml import etree
from script.get_user_info.response.codeforces_response import cf_response
# 得到用户在codeforces上的 solve problem number
def cf_problem_number(name):
    response = cf_response(name)
    html = etree.HTML(response)
    problem_number_cp = html.xpath('//div[@class="_UserActivityFrame_counterValue"]/text()')
    return int(problem_number_cp[0][:-9])

if __name__ == '__main__':
    print(cf_problem_number("S_zhi"))